class MaxScore extends eui.Component implements  eui.UIComponent {
	public numItems:CentralView;
	public scoreLbl:eui.Label;
	public returnBtn:eui.Button;

	private maxGameData:Array<number[]>;

	public constructor() {
		super();

		this.addEventListener(eui.UIEvent.COMPLETE, this.onComplete, this);
	}

	protected partAdded(partName:string,instance:any):void
	{
		super.partAdded(partName,instance);
	}


	protected childrenCreated():void
	{
		super.childrenCreated();
	}

	private onComplete()
	{
		this.returnBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onReturnBtn, this);

		let str = egret.localStorage.getItem("maxscoredata");
		this.maxGameData = MainLogic.getStorageData(str ? str : "");

		this.numItems.showData(this.maxGameData);

		str = egret.localStorage.getItem("maxscore");
		this.scoreLbl.text = str ? str : "0";
	}

	private onReturnBtn()
	{
		this.parent.removeChild(this);
	}
	
}